In [4]:
using HypothesisTests
ClassID = readdlm("Data/ClassifierID.dat", ',')
ClassNames = readdlm("Data/ClassifierNames.dat", ',')
DatasetID = readdlm("Data/DatasetID.dat", ',');
DatasetNames = readdlm("Data/DatasetNames.dat", ',');
Percent_correct = readdlm("Data/Percent_correct.dat", ',');
ii=0
for cl1=1:Int32(maximum(ClassID))
for cl2=cl1+1:Int32(maximum(ClassID))
ii=ii+1
indi=find(x->x==cl1,ClassID)
indj=find(x->x==cl2,ClassID)
acci=Float64[]
accj=Float64[]
for d=1:Int32(maximum(DatasetID))
indd=find(x->x==d,DatasetID)
indid=intersect(indi,indd)
indjd=intersect(indj,indd)
push!(acci,mean(Percent_correct[indid])/100)
push!(accj,mean(Percent_correct[indjd])/100)
end
pvalSignedRankTest=pvalue(SignedRankTest(acci,accj))
@printf "%s & %s & %1.3f \\\\\n" ClassNames[cl1] ClassNames[cl2] pvalSignedRankTest
end
end
In [1]:
using Distributions
using DataFrames
using Gadfly
using Compose
include("Tests/Bsignranktest.jl")
include("Tests/Bsigntest.jl")
include("Plots/plot_simplex.jl")
ClassID = readdlm("Data/ClassifierID.dat", ',')
ClassNames = readdlm("Data/ClassifierNames.dat", ',')
DatasetID = readdlm("Data/DatasetID.dat", ',');
DatasetNames = readdlm("Data/DatasetNames.dat", ',');
Percent_correct = readdlm("Data/Percent_correct.dat", ',');
p1=Array{Gadfly.Plot}(Int32(maximum(ClassID)*(maximum(ClassID)-1)/2))
data=0
ii=0
for cl1=1:Int32(maximum(ClassID))
for cl2=cl1+1:Int32(maximum(ClassID))
ii=ii+1
indi=find(x->x==cl1,ClassID)
indj=find(x->x==cl2,ClassID)
acci=Float64[]
accj=Float64[]
for d=1:Int32(maximum(DatasetID))
indd=find(x->x==d,DatasetID)
indid=intersect(indi,indd)
indjd=intersect(indj,indd)
push!(acci,mean(Percent_correct[indid])/100)
push!(accj,mean(Percent_correct[indjd])/100)
end
rope=0.01
#data=Bsigntest(acci,accj,rope)
data=Bsignranktest(acci,accj,rope)
#println(mean(data[3,:]), " ", mean(data[2,:]), " ",mean(data[1,:]))
val=zeros(size(data,2),1)
for ind=1:size(data,2)
val[ind,:]=indmax(data[:,ind])
end
@printf "%s & %s & %1.3f & %1.3f & %1.3f \\\\\n" ClassNames[cl1] ClassNames[cl2] length(find(x->x==3,val))/length(val) length(find(x->x==2,val))/length(val) length(find(x->x==1,val))/length(val)
ptriangle=plot_simplex(data, ClassNames[cl1],ClassNames[cl2])
p1[ii,:]=ptriangle
# pvalSignedRankTest=pvalue(SignedRankTest(acci,accj))
# @printf "%s & %s & %1.3f \\\\\n" ClassNames[cl1] ClassNames[cl2] pvalSignedRankTest
end
end
#set_default_plot_size(30cm, 40cm)
#display(vstack(hstack(p1[2,1],p1[3,1],p1[4,1]),
# hstack(p1[5,1],p1[6,1],p1[7,1]),
# hstack(p1[8,1],p1[9,1],p1[10,1])))
draw(PDF("Plots/plotmanytriangles.pdf", 30cm, 26cm),vstack(hstack(p1[2,1],p1[3,1],p1[4,1]),
hstack(p1[5,1],p1[6,1],p1[7,1]),
hstack(p1[8,1],p1[9,1],p1[10,1])))
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: